-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Move more methods into <RACStream> #135
Conversation
I mostly wanted to open this early because the takeWhileBlock: and takeUntilBlock: tests are failing for With some debug logging added to
The failures here look like another manifestation of #94, but for a finite signal (somehow). |
Yep, it's definitely #94. |
@Coneko Thanks for the pointer. I've added a workaround so that |
This should be ready for review and merging now (contingent upon #134). There are probably still a few other methods that could go into |
The resulting combined logic should be easier to follow and fix.
Conflicts: ReactiveCocoaFramework/ReactiveCocoa/RACSignal.m ReactiveCocoaFramework/ReactiveCocoaTests/RACStreamExamples.m
// as determined by `==` or `isEqual:`. | ||
// | ||
// Returns a stream of the receiver's values with sequential repeats removed. | ||
- (instancetype)skipRepeats; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this actually useful?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is just distinctUntilChanged
generalized. I don't see why we'd want to keep it confined to <RACSignal>
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, I'm just not sure it's actually useful for sequences. A method to get a distinct sequence, sure, but this seems minimally useful.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems to be a pretty common question for NSArray
, at least.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, so a method that removes all duplicates would be useful but this "Returns a stream of the receiver's values with sequential repeats removed."
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, quite right. I misinterpreted that search.
I'll revert this change.
This reverts commit 6104c9c. Conflicts: ReactiveCocoaFramework/ReactiveCocoa/RACStream.m
// Returns a stream which sends a RACTuple for each value in the receiver, where | ||
// the first object in the tuple is the value from the receiver, and the second | ||
// object in the tuple is `weakObject`. | ||
- (instancetype)injectObjectWeakly:(__weak id)weakObject; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd actually been meaning to remove this method entirely. Any objections to doing that instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why's that?
I know we don't use it, but I could see the strong/weak dance being abhorrent to some people.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it leads to more awkward code than the strong/weak dance does.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
Other than the 1 comment about removing |
📦 |
🍢 |
Move more methods into <RACStream>
No description provided.